from book_spider import save_txt
from openpyxl import load_workbook,Workbook
import _thread
from collections import deque
from spider_xia import SpiderManXia as SMX

##########################要传的值都放在这里了##############
charset = 'gbk'
book_name = '埃提亚'
book_author = '上帝不在天堂'
book_url = 'https://www.1200ksw.com/html/2/2282/'#目录url
目录链接页面中的第一章链接正则 ='</a></h3>[\s]+?<ul>[\S\s]+?<li><a href="(.*?)">.*?</a></li>'
拼接链接字符串 = '书目连接'#此网站拼接第一章的链接就为书目本身，就像这样传
文章中下一页连接 ='<a href="(.*?)">下一章</a>'
文章主体内容正则 ='<p class="articlecontent" id="articlecontent">(.*?)</p>'
文章标题正则 ='<div class="nr_title"><h3>(.*?)</h3>'

##############################################################

x = save_txt(
                charset,
                book_name,
                book_author,
                url = book_url,
                regex = 目录链接页面中的第一章链接正则,
                pingjie = 拼接链接字符串,
                regex_next_url = 文章中下一页连接,
                regex_content = 文章主体内容正则,
                regex_title = 文章标题正则,
                
                )
x
































